from flask_restful import reqparse, fields


class UserResource(object):
    fields = {
        'id': fields.Integer,
        'username': fields.Integer,
        'password': fields.String
    }

    @classmethod
    def validate_login(cls):
        parser = reqparse.RequestParser()
        parser.add_argument('username', type=int, help='Username(Phone Number):int', location=['json'])
        parser.add_argument('password', type=str, help='Password:str', location=['json'])
        return parser.parse_args()

    @classmethod
    def validate_create(cls):
        return cls.validate_login()
